<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>词多多代理商平台</title>
     <include file="Index:header" />
     <script type="text/javascript">
        $(function(){
            $(".help-side dl dd:eq(2)").addClass('cur');
            $("#top #topcon .nav li:eq(1)").addClass('cur');
        })
    </script>
    <script src="__PUBLIC__/js/main.js" type="text/javascript" charset="UTF-8"></script>
    <script src="__PUBLIC__/js/ajaxform.js" type="text/javascript"></script>
</head>
<body>
<include file="Index:top"/>
<div id="main">
   <include file="User:left"/>
    <div id="main_right" class="container">
        <div class="title c mt10">客户充值
            <if condition="$userId neq 0">
                <button class="button_s green" style="float:right;margin-top:5px; padding:1px 10px"
                        onclick="window.history.go(-1)">返回</button>
            </if>
        </div>
        <div id="home_info" class="container mt40 ml60" style="width:650px;height:300px;">
            <form name="form1" id="form1" class="form" showOnMouseOver="false">
            <table border=1 bordercolor=#e7e7e7 cellpadding=5 cellspacing=0 width="100%" height="100%" align="center">

                <tr>
                    <td colspan='3' bgcolor="#F6F7F6"  class="pl15">
                        客户充值
                    </td>
                </tr>
                <tr>
                    <td width="20%" align="right" style="padding-right:10px;">用&nbsp;户&nbsp;名</td>
                    <if condition="$userList['Username'] neq ''">
                     <td colspan="2"> <input type="text" name="userName" class="input" value="{$userList['Username']}" readonly="readonly"/></td>
                        <else/>
                        <td style="border-right-style:none;">
                        <input type="text" name="userName" id="userName" class="validate[required,zhengshu] input"
                               onkeydown="enterPress(event)"/>
                    </td>
                        <td width="40%" style="border-left-style:none;"><div class="validation_info"></div></td>
                    </if>
                </tr>
                <tr>
                    <td  align="right" style="padding-right:10px;">真实姓名</td>
                    <td style="padding-left:20px;" colspan="2"><span id="realName">{$userList['Realname']}</span></td>
                </tr>

                <tr>
                    <td  align="right" style="padding-right:10px;">公司名称</td>
                    <td style="padding-left:20px;" colspan="2"><span id="company">{$userList['Company']}</span></td>
                </tr>

                <tr>
                    <td  align="right" style="padding-right:10px;">余&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额</td>
                    <td style="padding-left:20px;" colspan="2"><span id="money">{$userList['Usermoney']}</span></td>
                </tr>

                <tr>
                    <td  align="right" style="padding-right:10px;">充值金额</td>
                    <td style="border-right-style:none;">
                        <input type="text" id="addMoney" name="addMoney" class="validate[required,custom[zhengshu]] input" />&nbsp;&nbsp;元
                    </td>
                    <td style="border-left-style:none;"><div class="validation_info"></div></td>
                </tr>

                <tr>
                    <td  align="right" style="padding-right:10px;">大&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;写</td>
                    <td style="padding-left:20px;" colspan="2"><span id="superMoney"></span></td>
                </tr>

                <tr>
                    <td  colspan='3'align="center">
                   <input type="button" class="button_s green"
                          onclick="query();" value="充值"/>
                    </td>
                </tr>
            </table>
            </form>
        </div>
    </div>
</div>
<include file="Index:footer"/>
<script type="text/javascript">
    $(function () {
        $("#domain").sSelect();
        $("#keyword").sSelect();
    });
    function enterPress(e) {
        if (e.keyCode == 13) {
             ajaxuserinfo();
        }
    }
    function ajaxuserinfo(){
        userName=$("#userName").val();
        get_url = "__ROOT__/User/userinfo";
        $.ajax({
            url:get_url,
            type:'POST',
            data:{'userName':userName},
            cache:false,
            dataType:"json",
            success:function(data){
                if(data.status =='true'){
                    $("#realName").html(data.Realname);
                    $("#company").html(data.Company);
                    $("#money").html(data.Usermoney);
                }else{
                    msgwarn(data.errMsg);
                    $("#realName").empty();
                    $("#company").empty();
                    $("#money").empty();                    
                }
            }
        });
    }
    $("#userName").blur(function(){
        ajaxuserinfo();
    });

    $("#addMoney").blur(function(){
        superMoney=convertCurrency($(this).val());
        $("#superMoney").html(superMoney);
    });

    function query(){
        superMoney=convertCurrency($("#addMoney").val());
        art.dialog({
            title:'提示',
            content:'充值金额为'+superMoney,
            icon:'question',
            lock: true,
            ok: function(){
                validateForm('#form1','__URL__/userrechargesave','__APP__/Order/ordercontent');
            },
            cancelVal: '取消',
            cancel: true
        });
    }

    $("#addMoney").keyup(function(){
        superMoney=convertCurrency($(this).val());
        $("#superMoney").html(superMoney);
    });
</script>
</body>
</html>